package com.jrx.anytxn.accounting.job.voucherFile.step;

import com.jrx.anytxn.accounting.entity.GaVoucherInfo;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.batch.MyBatisPagingItemReader;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

public class VoucherFileReader extends MyBatisPagingItemReader<GaVoucherInfo> {

    public VoucherFileReader(Date businessDate, SqlSessionFactory sqlSessionFactory, Integer pagesize) {

        setSaveState(false);
        setPageSize(pagesize);
        setSqlSessionFactory(sqlSessionFactory);
        setQueryId("com.jrx.anytxn.accounting.mapper.ext.ExtVoucherInfoMapper.selectVoucherByDateForBillingBatch");
        Map<String, Object> map = new HashMap<>();
        map.put("businessDate",businessDate);
        setParameterValues(map);
    }
}
